﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using DevExpress.CrmDemo.Win.Reports;
using DevExpress.CrmDemo.Win.Data;

namespace DevExpress.CrmDemo.Win.Controls {
    public partial class ReportViewer : DevExpress.XtraEditors.XtraUserControl {
        public ReportViewer() {
            InitializeComponent();

            report = new OpportunityReport();
        }

        OpportunityReport report;

        public BindingList<Opportunity> Opportunities {
            set { report.DataSource = value; }
        }

        private void ReportViewer_Load(object sender, EventArgs e) {
            printControl1.PrintingSystem = report.PrintingSystem;

            report.CreateDocument();
        }
    }
}
